home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir42 / cdd3007b.zip / CDD6TO7.BAT < prev    next >
DOS Batch File  |  1994-01-21  |  16KB  |  387 lines

  1. @ECHO OFF
  2.  
  3. CLS
  4. IF "%1"=="" GOTO SYNTAX
  5.  
  6. ECHO ╔═════════════════════════════════════════════════════════════╗
  7. ECHO ║          CDD 3.O patch for version 3006                     ║
  8. ECHO ║                                                             ║
  9. ECHO ║ This patchfile implements fixes to CDD version 3006. This   ║
  10. ECHO ║ patch will ONLY work on CDD version 3006.                   ║
  11. ECHO ╚═════════════════════════════════════════════════════════════╝
  12.  
  13. ECHO ╔═════════════════════════════════════════════════════════════╗
  14. ECHO ║ If you are using a version prior to 3006, you can order     ║
  15. ECHO ║ a complete install set from the Customer Service department ║
  16. ECHO ║ at 305-785-4555, for $10.00 plus shipping charges.          ║
  17. ECHO ╚═════════════════════════════════════════════════════════════╝
  18.  
  19. ECHO ╔═════════════════════════════════════════════════════════════╗
  20. ECHO ║ Press any key to continue or Control-C to abort.            ║
  21. ECHO ╚═════════════════════════════════════════════════════════════╝
  22. pause
  23.  
  24. if not exist PATCH.EXE GOTO missing_file
  25. if not exist ISIT3006.RTP GOTO missing_file
  26. if not exist CDD6TO7.RTP GOTO missing_file
  27. if not exist 6TO7CONT.RTP GOTO missing_file
  28.  
  29.  
  30. ECHO ╔══════════════════════════════════╗
  31. ECHO ║ Verifying that the 3006 version  ║
  32. ECHO ║ of CLARION3.EXE is installed in: ║ " %1 "
  33. ECHO ╚══════════════════════════════════╝
  34.  
  35. PATCH %1 -E ISIT3006.RTP
  36.  
  37. IF ERRORLEVEL 37 GOTO ERRORFILE
  38. IF ERRORLEVEL 36 GOTO BADVER
  39. IF ERRORLEVEL 35 GOTO SYNTAX
  40. IF ERRORLEVEL 34 GOTO NOTADIR
  41. IF ERRORLEVEL 29 GOTO NOSPACE
  42. IF ERRORLEVEL 24 GOTO CONT_PATCH
  43. IF ERRORLEVEL 16 GOTO CONT_PATCH
  44. IF ERRORLEVEL 15 GOTO BADVER_15
  45. IF ERRORLEVEL 9 GOTO BAD_PATCHFILE
  46. IF ERRORLEVEL 8 GOTO BAD_PATCHEXE
  47. IF ERRORLEVEL 5 GOTO NOTADIR
  48. IF ERRORLEVEL 4 GOTO NOTADIR
  49. IF ERRORLEVEL 1 GOTO SYNTAX
  50.  
  51. ECHO ╔════════════════════════════════════════════════════════════════════════╗
  52. ECHO ║  The 3006 version of Clarion3.exe has been patched!                    ║
  53. ECHO ║  Before applying the PATCH for CDD we can make copies of the following ║
  54. ECHO ║  files:  *.TXT, *.HLP, ???BROWS.*, ???REPEA.*, CLARION.APP             ║
  55. ECHO ║       :  BROWSE.INC, REPEAT.INC, BROWSE.PR, REPEAT.PR                  ║
  56. ECHO ║       :  *.TP?, the Clarion *.HLP and *.TXT files                      ║
  57. ECHO ╚════════════════════════════════════════════════════════════════════════╝
  58. GOTO START_BACKUP
  59.  
  60. :CONT_PATCH
  61. ECHO ╔════════════════════════════════════════════════════════════════════════╗
  62. ECHO ║  Found a 3007 version of Clarion3.exe !                                ║
  63. ECHO ║  the 3006 version of Clarion3.exe has ALREADY been patched!            ║
  64. ECHO ║  Before applying the PATCH for CDD we can make copies of the following ║
  65. ECHO ║  files:  *.TXT, *.HLP, ???BROWS.*, ???REPEA.*, CLARION.APP             ║
  66. ECHO ║       :  BROWSE.INC, REPEAT.INC, BROWSE.PR, REPEAT.PR                  ║
  67. ECHO ║       :  CLARION??.TP?, the Clarion *.HLP and *.TXT files              ║
  68. ECHO ╚════════════════════════════════════════════════════════════════════════╝
  69. GOTO START_BACKUP
  70.  
  71.  
  72. :START_BACKUP
  73. YESNO Should we make copies of these files? [Y/N]
  74. IF ERRORLEVEL 1 GOTO skip_backup
  75.  
  76. ECHO ╔═════════════════════════════════════════╗
  77. ECHO ║  FILES WILL BE COPIED to the directory: ║ %1\SAVECDD
  78. ECHO ╚═════════════════════════════════════════╝
  79.  
  80. MD  %1\SAVECDD >nul
  81. COPY CDD6TO7.BAT %1\SAVECDD >nul
  82. if not exist %1\SAVECDD\CDD6TO7.BAT GOTO DIRTEST_FAILED
  83. DEL %1\SAVECDD\CDD6TO7.BAT >nul
  84.  
  85. ECHO Copying files from %1 to %1\SAVECDD\*.*
  86.  
  87. copy %1\*.tp? %1\SAVECDD >nul
  88.  
  89. copy %1\appgn.txt %1\SAVECDD >nul
  90. copy %1\clarion.txt %1\SAVECDD >nul
  91. copy %1\txted.txt %1\SAVECDD >nul
  92. copy %1\envir.txt %1\SAVECDD >nul
  93. copy %1\hlped.txt %1\SAVECDD >nul
  94. copy %1\rptwr.txt %1\SAVECDD >nul
  95. copy %1\cshell.txt %1\SAVECDD >nul
  96. copy %1\dbmmg.txt %1\SAVECDD >nul
  97. copy %1\dcted.txt %1\SAVECDD >nul
  98.  
  99. copy %1\clarion.hlp %1\SAVECDD >nul
  100. copy %1\clarion3.hlp %1\SAVECDD >nul
  101. copy %1\editor.hlp %1\SAVECDD >nul
  102. copy %1\cshell.hlp %1\SAVECDD >nul
  103.  
  104. copy %1\clarion.sty %1\SAVECDD >nul
  105. copy %1\standard.sty %1\SAVECDD >nul
  106. copy %1\neon.sty %1\SAVECDD >nul
  107.  
  108. copy %1\browse.cla %1\SAVECDD >nul
  109. copy %1\browse.pr %1\SAVECDD   >nul
  110. copy %1\browse.inc %1\SAVECDD >nul
  111. copy %1\???brows.dll %1\SAVECDD >nul
  112. copy %1\lib\???brows.lib %1\SAVECDD >nul
  113.  
  114. copy %1\repeat.cla %1\SAVECDD >nul
  115. copy %1\repeat.pr  %1\SAVECDD >nul
  116. copy %1\repeat.inc %1\SAVECDD >nul
  117. copy %1\???repea.dll %1\SAVECDD >nul
  118. copy %1\lib\???repea.lib %1\SAVECDD >nul
  119.  
  120. copy %1\clarion.app %1\SAVECDD   >nul
  121.  
  122. ECHO ╔════════════════════════════════════════════════╗
  123. ECHO ║ Verifying the files were copied                ║
  124. ECHO ╚════════════════════════════════════════════════╝
  125.  
  126. if not exist %1\SAVECDD\clarion.tpl   GOTO COPY_FAILED
  127. if not exist %1\SAVECDD\clarion1.tpx GOTO COPY_FAILED
  128. if not exist %1\SAVECDD\clarion2.tpx GOTO COPY_FAILED
  129. if not exist %1\SAVECDD\clarion3.tpx GOTO COPY_FAILED
  130. if not exist %1\SAVECDD\clarion4.tpx GOTO COPY_FAILED
  131. if not exist %1\SAVECDD\clarion5.tpx GOTO COPY_FAILED
  132. if not exist %1\SAVECDD\clarion6.tpx GOTO COPY_FAILED
  133. if not exist %1\SAVECDD\clarion7.tpx GOTO COPY_FAILED
  134. if not exist %1\SAVECDD\clarion8.tpx GOTO COPY_FAILED
  135. if not exist %1\SAVECDD\clarion9.tpx GOTO COPY_FAILED
  136. if not exist %1\SAVECDD\clario90.tpx GOTO COPY_FAILED
  137.  
  138. if not exist %1\SAVECDD\appgn.txt GOTO COPY_FAILED
  139. if not exist %1\SAVECDD\clarion.txt GOTO COPY_FAILED
  140. if not exist %1\SAVECDD\txted.txt GOTO COPY_FAILED
  141. if not exist %1\SAVECDD\envir.txt GOTO COPY_FAILED
  142. if not exist %1\SAVECDD\hlped.txt GOTO COPY_FAILED
  143. if not exist %1\SAVECDD\rptwr.txt GOTO COPY_FAILED
  144. if not exist %1\SAVECDD\cshell.txt GOTO COPY_FAILED
  145. if not exist %1\SAVECDD\dbmmg.txt GOTO COPY_FAILED
  146. if not exist %1\SAVECDD\dcted.txt GOTO COPY_FAILED
  147.  
  148. if not exist %1\SAVECDD\clarion.hlp GOTO COPY_FAILED
  149. if not exist %1\SAVECDD\clarion3.hlp GOTO COPY_FAILED
  150. if not exist %1\SAVECDD\editor.hlp GOTO COPY_FAILED
  151. if not exist %1\SAVECDD\cshell.hlp GOTO COPY_FAILED
  152.  
  153. if not exist %1\SAVECDD\clarion.sty GOTO COPY_FAILED
  154. if not exist %1\SAVECDD\standard.sty GOTO COPY_FAILED
  155. if not exist %1\SAVECDD\neon.sty GOTO COPY_FAILED
  156.  
  157. if not exist %1\SAVECDD\browse.cla GOTO COPY_FAILED
  158. if not exist %1\SAVECDD\browse.pr GOTO COPY_FAILED
  159. if not exist %1\SAVECDD\browse.inc GOTO COPY_FAILED
  160. if not exist %1\SAVECDD\DDVbrows.dll GOTO COPY_FAILED
  161. if not exist %1\SAVECDD\DDVbrows.lib GOTO COPY_FAILED
  162. if not exist %1\SAVECDD\DOVbrows.lib GOTO COPY_FAILED
  163. if not exist %1\SAVECDD\DXVbrows.lib GOTO COPY_FAILED
  164.  
  165. if not exist %1\SAVECDD\repeat.cla GOTO COPY_FAILED
  166. if not exist %1\SAVECDD\repeat.pr GOTO COPY_FAILED
  167. if not exist %1\SAVECDD\repeat.inc GOTO COPY_FAILED
  168. if not exist %1\SAVECDD\DDVrepea.dll GOTO COPY_FAILED
  169. if not exist %1\SAVECDD\DDVrepea.lib GOTO COPY_FAILED
  170. if not exist %1\SAVECDD\DOVrepea.lib GOTO COPY_FAILED
  171. if not exist %1\SAVECDD\DXVrepea.lib GOTO COPY_FAILED
  172.  
  173. if not exist %1\SAVECDD\clarion.app GOTO COPY_FAILED
  174.  
  175. ECHO ╔════════════════════════════════════════════════╗
  176. ECHO ║ File copies have been verified!                ║
  177. ECHO ╚════════════════════════════════════════════════╝
  178.  
  179.  
  180. YESNO Should we DELETE the ORIGINAL files we just backed up? [Y/N]
  181. IF ERRORLEVEL 1 GOTO skip_delete
  182.  
  183. del %1\clarion.tpl >nul
  184. del %1\clarion1.tpx >nul
  185. del %1\clarion2.tpx >nul
  186. del %1\clarion3.tpx >nul
  187. del %1\clarion4.tpx >nul
  188. del %1\clarion5.tpx >nul
  189. del %1\clarion6.tpx >nul
  190. del %1\clarion7.tpx >nul
  191. del %1\clarion8.tpx >nul
  192. del %1\clarion9.tpx >nul
  193. del %1\clario90.tpx >nul
  194.  
  195. del %1\appgn.txt  >nul
  196. del %1\clarion.txt >nul
  197. del %1\txted.txt  >nul
  198. del %1\envir.txt  >nul
  199. del %1\hlped.txt  >nul
  200. del %1\rptwr.txt  >nul
  201. del %1\cshell.txt >nul
  202. del %1\dbmmg.txt  >nul
  203. del %1\dcted.txt  >nul
  204.  
  205. del %1\clarion.hlp  >nul
  206. del %1\clarion3.hlp >nul
  207. del %1\editor.hlp  >nul
  208. del %1\cshell.hlp >nul
  209.  
  210. del %1\clarion.sty >nul
  211. del %1\standard.sty >nul
  212. del %1\neon.sty  >nul
  213.  
  214. del %1\browse.cla  >nul
  215. del %1\browse.pr   >nul
  216. del %1\browse.inc  >nul
  217.  
  218. del %1\repeat.cla >nul
  219. del %1\repeat.pr  >nul
  220. del %1\repeat.inc >nul
  221.  
  222. del %1\clarion.app  >nul
  223.  
  224. GOTO NEXT_PHASE
  225.  
  226. :COPY_FAILED
  227. ECHO ╔═══════════════════════════════════════════════╗
  228. ECHO ║  WARNING:                                     ║
  229. ECHO ║  Cannot verify the file COPY was correct.     ║
  230. ECHO ║  Files WILL NOT BE DELETED                    ║
  231. ECHO ╚═══════════════════════════════════════════════╝
  232. GOTO skip_delete
  233.  
  234. :skip_delete
  235. :skip_backup
  236.  
  237. :NEXT_PHASE
  238. ECHO ╔════════════════════════════════════════════════════════════════════╗
  239. ECHO ║  Now applying patch to upgrade CDD 3006 to revision 3007           ║
  240. ECHO ║  If an error occurs during the PATCH process an Error file will    ║
  241. ECHO ║  be created as PATCH.ERR                                           ║
  242. ECHO ╚════════════════════════════════════════════════════════════════════╝
  243.  
  244. PATCH %1 -E CDD6TO7.RTP
  245. PATCH %1 -E 6TO7CONT.RTP
  246. COPY %1\*.LIB %1\LIB\*.* >NUL
  247. DEL %1\*.LIB >NUL
  248. PATCH %1\DOC -E 3007DOC.RTP
  249. COPY %1\*.DOC %1\DOC >NUL
  250. DEL %1\*.DOC >NUL
  251. PATCH %1\EXAMPLE -E 3007EXAM.RTP
  252. ECHO *
  253. ECHO *
  254. GOTO patch_complete
  255.  
  256. :NOTADIR
  257. ECHO ╔═════════════════════════════════╗
  258. ECHO ║ CANNOT FIND A DIRECTORY NAMED:  ║  " %1 "
  259. ECHO ╚═════════════════════════════════╝
  260. GOTO SYNTAX
  261.  
  262. :SYNTAX
  263. ECHO ╔═════════════════════════════════════════════════════════════╗
  264. ECHO ║ This patch should be applied by UNZIPPING P3007.ZIP         ║
  265. ECHO ║ then typing:                                                ║
  266. ECHO ║                                                             ║
  267. ECHO ║  CDD6TO7 [DRIVE:\DIRECTORY]                                 ║
  268. ECHO ║                                                             ║
  269. ECHO ║  where [DRIVE:\DIRECTORY] is the name of the drive and path ║
  270. ECHO ║         where CDD 3.0 is installed                          ║
  271. ECHO ║                                                             ║
  272. ECHO ║                                                             ║
  273. ECHO ║  example: if CDD 3.0 is installed in C:\Clarion3            ║
  274. ECHO ║           then type CDD6TO7 C:\Clarion3                     ║
  275. ECHO ║                                                             ║
  276. ECHO ╚═════════════════════════════════════════════════════════════╝
  277. GOTO EXIT
  278.  
  279. :ERRORFILE
  280. ECHO   An error occurred when Patch.exe was opening %1\Patch.err
  281. ECHO ╔════════════════════════════════════════════════════════════════════╗
  282. ECHO ║ The probable cause is some type of DOS error, retry the operation  ║
  283. ECHO ║ after checking the disks integrity.                                ║
  284. ECHO ╚════════════════════════════════════════════════════════════════════╝
  285. GOTO EXIT
  286.  
  287. :BADVER
  288. ECHO   CANNOT find Clarion3.exe version 3006 installed in %1
  289. ECHO ╔════════════════════════════════════════════════════════════════════════╗
  290. ECHO ║ error ept0036: Old file not found. However, a file of the same name    ║
  291. ECHO ║          was found. No update done since file contents do not match.   ║
  292. ECHO ║                                                                        ║
  293. ECHO ║ PATCH was unable to locate an exact match for the original file to     ║
  294. ECHO ║ be updated. However, PATCH was able to locate a file with the same     ║
  295. ECHO ║ name as the original file. However, the file found did not have either ║
  296. ECHO ║ the same size or checksum as the actual original file that PATCH is    ║
  297. ECHO ║ seeking in order to perform the update.                                ║
  298. ECHO ╚════════════════════════════════════════════════════════════════════════╝
  299.  
  300. GOTO EXIT
  301. :BADVER_15
  302. ECHO ╔════════════════════════════════════════════════════════════════════════╗
  303. ECHO ║                                                                        ║
  304. ECHO ║ CANNOT find Clarion3.exe version 3006                                  ║
  305. ECHO ║ error ept0015: Old file does not exist                                 ║
  306. ECHO ║                                                                        ║
  307. ECHO ║ PATCH needs Bytes from the existing version of a file in order to build║
  308. ECHO ║ the new file. However, it was unable to locate the old file.           ║
  309. ECHO ╚════════════════════════════════════════════════════════════════════════╝
  310. GOTO EXIT
  311.  
  312. :patch_complete
  313. IF NOT EXIST %1\PATCH.ERR GOTO noerrors
  314. ECHO 
  315. ECHO ╔═════════════════════════════════════════════════════╗
  316. ECHO ║ PATCH HAS ERRORs, press any key to view error file  ║
  317. ECHO ║ after viewing the errors you can rerun the patch    ║
  318. ECHO ╠═════════════════════════════════════════════════════╣
  319. ECHO ║  The following errors can be ignored:               ║
  320. ECHO ║                                                     ║
  321. ECHO ║  ept0016: New file already exists                   ║
  322. ECHO ║  ept0024: New file already exists                   ║
  323. ECHO ╚═════════════════════════════════════════════════════╝
  324.  
  325. EDITOR %1\PATCH.ERR
  326.  
  327. CLS
  328. ECHO ╔══════════════════════════════════════════════════════════════════════╗
  329. ECHO ║ A complete install set is available from Clarion Customer Service    ║
  330. ECHO ║ at 305-785-4555 for $10.00 plus shipping charges.                    ║
  331. ECHO ║                                                                      ║
  332. ECHO ╚══════════════════════════════════════════════════════════════════════╝
  333. pause
  334. GOTO EXIT
  335.  
  336. :missing_file
  337. ECHO ╔════════════════════════════════════════════════════════════╗
  338. ECHO ║ Cannot locate patch file(s)                                ║
  339. ECHO ║ This patch should be applied by UNZIPPING P3007.ZIP        ║
  340. ECHO ║ then typing:                                               ║
  341. ECHO ║                 CDD6TO7 [DRIVE:\DIRECTORY]                 ║
  342. ECHO ╚════════════════════════════════════════════════════════════╝
  343. GOTO EXIT
  344.  
  345. :nospace
  346. ECHO ╔════════════════════════════════════════════════════════════╗
  347. ECHO ║                                                            ║
  348. ECHO ║ There is insufficient disk space to apply the Patch,       ║
  349. ECHO ║ please free up some space and reapply the Patch.           ║
  350. ECHO ║                                                            ║
  351. ECHO ╚════════════════════════════════════════════════════════════╝
  352. GOTO EXIT
  353.  
  354. :BAD_PATCHFILE
  355. ECHO ╔════════════════════════════════════════════════════════════╗
  356. ECHO ║ error ept0009:                                             ║
  357. ECHO ║ PATCH.EXE was unable to read the correct information       ║
  358. ECHO ║ from the patch file.  Get a new copy and rerun the PATCH   ║
  359. ECHO ║                                                            ║
  360. ECHO ╚════════════════════════════════════════════════════════════╝
  361. GOTO EXIT
  362.  
  363. :BAD_PATCHEXE
  364. ECHO ╔════════════════════════════════════════════════════════════╗
  365. ECHO ║ error ept0008: PATCH.EXE and Patch file are incompatible   ║
  366. ECHO ║                                                            ║
  367. ECHO ║ You need a new copy of PATCH.EXE to apply this patch.      ║
  368. ECHO ║                                                            ║
  369. ECHO ╚════════════════════════════════════════════════════════════╝
  370. GOTO EXIT
  371.  
  372. :dirtest_failed
  373. ECHO   Unable to create directory %1\SAVECDD
  374. ECHO ╔═══════════════════════════════════════════════════════╗
  375. ECHO ║ Cannot perform backup of files, we suggest you        ║
  376. ECHO ║ backup your files and then rerun the patch            ║
  377. ECHO ║ but answer NO to the backup prompt.                   ║
  378. ECHO ╚═══════════════════════════════════════════════════════╝
  379. GOTO EXIT
  380.  
  381. :noerrors
  382. ECHO  
  383. ECHO ╔═════════════════════════════════════════════════╗
  384. ECHO ║  Patch is complete, no errors encountered!      ║
  385. ECHO ╚═════════════════════════════════════════════════╝
  386. :EXIT
  387.